import re
l = ['root     59599     1 99 16:55 pts/2    00:02:13 /usr/local/jdk1.7.0_80/bin/java -Djava.util.logging.config.file=/usr/local/apache-tomcat-7.0.69/conf/logging.',
     'root     59807 59635  0 16:57 pts/1    00:00:00 /bin/sh -c ps -ef |grep tomcat',
     'root     59809 59807  0 16:57 pts/1    00:00:00 grep tomcat']
for i in range(len(l)):
    tempps = l[i]
    t = re.search('/usr/local/jdk',tempps)
    if t != None:
        lt = tempps.split(' ')
        tl = []
        for j in range(len(lt)):
            if lt[j] != '':
                tl.append(lt[j])
        print(tl[1])


